package com.example.eurekaconfigclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  高可用的分布式配置中心 通过把配置中心作为一个微服务 ，并且将其集群化，从而达到高可用
 */
@SpringBootApplication
@EnableEurekaClient
@RestController
@RefreshScope
public class EurekaconfigclientApplication {

	public static void main(String[] args) {
		SpringApplication.run(EurekaconfigclientApplication.class, args);
	}

	@Value("${hello}")
	String hello;

	@RequestMapping(value = "/hi")
	public String hi(){
		return hello;
	}
}
